package com.jt.assistant.utils;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;

import com.blankj.utilcode.util.ToastUtils;
import com.orhanobut.logger.Logger;

public class BaseTools {
    public static int getWindowWidth(Context context) {
        // 获取屏幕分辨率
        WindowManager wm = (WindowManager) (context.getSystemService(Context.WINDOW_SERVICE));
        DisplayMetrics dm = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(dm);
        int mScreenWidth = dm.widthPixels;
        Logger.e(dm.widthPixels + "," + dm.heightPixels + "," + dm.densityDpi);
        ToastUtils.showShort(dm.widthPixels + "," + dm.heightPixels + "," + dm.densityDpi);
        return mScreenWidth;
    }

    public static int getWindowHeigh(Context context) {
        // 获取屏幕分辨率
        WindowManager wm = (WindowManager) (context.getSystemService(Context.WINDOW_SERVICE));
        DisplayMetrics dm = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(dm);
        int mScreenHeigh = dm.heightPixels;
        return mScreenHeigh;
    }
}
